<template>
  <el-dialog title="探针雷达" :visible.sync="dialogVisible" width="900px">
    <h2>{{ xxx }}探针雷达详情</h2>
    <br>
    <el-row>
      <el-col :span="8">报告生成时间：{{ }}</el-col>
      <el-col :span="8">有效期至：{{ }}</el-col>
      <el-col :span="8">订单ID：{{ }}</el-col>
    </el-row>
    <br>
    <el-descriptions title="" direction="vertical" :column="4" border>
      <el-descriptions-item label="探查结果编码">{{ getType(allData?.result_code) || '--' }}</el-descriptions-item>
      <el-descriptions-item label="最大逾期金额">{{ allData?.max_overdue_amt || '--' }}</el-descriptions-item>
      <el-descriptions-item label="最长逾期天数">{{ allData?.max_overdue_days || '--' }}</el-descriptions-item>
      <el-descriptions-item label="最近逾期时间">{{ allData?.latest_overdue_time || '--' }}</el-descriptions-item>
      <el-descriptions-item label="最大履约金额">{{ allData?.max_performance_amt || '--' }}</el-descriptions-item>
      <el-descriptions-item label="最近履约时间">{{ allData?.latest_performance_time || '--' }}</el-descriptions-item>
      <el-descriptions-item label="履约笔数">{{ allData?.count_performance || '--' }}</el-descriptions-item>
      <el-descriptions-item label="当前逾期机构数">{{ allData?.currently_overdue || '--' }}</el-descriptions-item>
      <el-descriptions-item label="当前履约机构数">{{ allData?.currently_performance || '--' }}</el-descriptions-item>
      <el-descriptions-item label="异常还款机构数">{{ allData?.acc_exc || '--' }}</el-descriptions-item>
      <el-descriptions-item label="睡眠机构数">{{ allData?.acc_sleep || '--' }}</el-descriptions-item>
    </el-descriptions>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogVisible = false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getBehaviorData } from '@/api/order'
export default {
  props: {
    editItem: {
      type: Object,
      default: () => ({})
    },
  },
  data() {
    return {
      dialogVisible: false,
      cert_name: '',
      start_at: '',
      level: '',
      allData: {}
    }
  },
  watch: {
    dialogVisible(val) {
      if (val) {
        this.$nextTick(() => {
          this.getList()
        })
      }
    }
  },
  methods: {
    getType(num) {
      return num == 1 ? '逾期未还款' : num == 2 ? '正常履约' : num == 3 ? '逾期又还款' : num == 4 ? '无法确定' : '--'
    },
    getList() {
      let params={
        cert_name:this.editItem.authentic.cert_name,
        mobile:this.editItem.mobile,
        cert_no:this.editItem.authentic.cert_no,
        orderId:this.editItem.id,
      }
      getBehaviorData(params).then(res => {
        console.log(res);
      })
    }
  }
}
</script>

<style lang="scss" scoped></style>
